package edu.gatech.arktos;

import java.util.HashSet;
import java.util.Set;

public class Project implements ProjectInterface{
	String description; // Description
	String name; // Projects
	int grade;
	int averagescore;
	HashSet<Team> teams;

	public Project(String name, String description , int average , HashSet<Team> teame) {
		this.description = description;
		this.name = name;
		this.averagescore = average;
		this.teams = teame;
	}

	/**
	 * Getter
	 * 
	 * @return description - name of Project
	 */
	public String getDescription() {
		return this.description;
	}

	/**
	 * Getter
	 * 
	 * @return name - Project Number
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Getter
	 * 
	 * @return grade - Project grade
	 */
	public int getGrade() {
		return this.grade;
	}

	public void setGrade(int grade) {
		this.grade = grade;
	}

	@Override
	public String getProjectDescription() {
		return this.description;
	}

	public int getAverageScore() {
		return this.averagescore;
	}

	public HashSet<Team> getTeams() {
		return teams;
	}

	public Team getTeamByName(String string) {
		int num = 0;

		Object[] teamArray = this.teams.toArray();
		if(string.compareTo("Team 1") == 0) num = 0;
		if(string.compareTo("Team 2") == 0) num = 1;
		if(string.compareTo("Team 3") == 0) num = 2;
		return (Team)teamArray[num];
		
	}

	@Override
	public String getProjectName() {
		return this.name;
	}

	@Override
	public void setProjectName(String projectName) {
		this.name = projectName;		
	}

	@Override
	public void setProjectDescription(String projectDescription) {
		this.description = projectDescription;		
	}

	@Override
	public void addTeam(Team team) {
		teams.add(team);
	}

	@Override
	public void setTeams(HashSet<Team> teams) {
		this.teams = teams;
	}

}
